{include file="common/index_header"/}
<style>
    .login_ad {
        width: 66%;
        margin: auto auto 25px auto;
        color: #ef841a;
        text-align: center;
        font-weight: 500;
        padding: 10px 0px;
        float: left;
        border-bottom: 2px solid #ef841a;
    }
</style>
</head>
<div class="login">
    <div class="imgs" style="background: url(__STATIC__/lib/index_new/images/fimg2.jpg) no-repeat center/cover;">
        <h3>More flexibility to control your business expenses with BetterEpay cards</h3>
    </div>
    <div class="lts">
        <div class="text">
            <form action="" method="post" class="layui-form">
                <div class="ico"><img src="__STATIC__/lib/index_new/images/logo.png" ></div>
                <div class="login_ad">ACCOUNT PASSWORD LOGIN</div>
                <div class="tet">
                    <div class="ic"><img src="__STATIC__/lib/index_new/images/fc17.png" ></div>
                    <input type="text" class="t" name="username" value="{$username}" readonly style="border: 0px;"/>
                </div>
                <div class="tet">
                    <div class="ic"><img src="__STATIC__/lib/index_new/images/fc18.png" ></div>
                    <input type="password" class="t" name="new_password" id="new_password" lay-verType="tips" lay-verify="required_en"
                            placeholder="please input new password" />
                </div>
                <div class="tet">
                    <div class="ic"><img src="__STATIC__/lib/index_new/images/fc18.png" ></div>
                    <input type="password" class="t" name="confirm_password" id="confirm_password" lay-verType="tips" lay-verify="required_en"
                         placeholder="please input confirm password" />
                </div>
                <input class="sub" type="button" value="Confirm" lay-submit lay-filter="login" />
                <div class="dont">
                    <h5>Existing accounts?<a href="{:url('login/login')}">Log' In</a></h5>
                </div>
            </form>
        </div>
    </div>
</div>
<body>
<script>
    layui.config({
        base: '__STATIC__/lib/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form'], function() {
        var $ = layui.$,
            form = layui.form;

        $('#new_password').val('');
        $('#confirm_password').val('');
        form.render();
        //提交
        form.on('submit(login)', function(data) {
            $new_password       = $('#new_password').val();
            $confirm_password   = $('#confirm_password').val();
            if($new_password != $confirm_password){
                layer.msg('The two passwords don\'t match.' , {time:2000 , icon:2});
                return false;
            }

            JsPost("{:url('login/pwdChange')}", data.field, function(data){
                if (data.code > 0) {
                    layer.msg(data.msg, {icon:16,time:1500});
                    setTimeout("window.location.href='" +  "{:url('login/login')}" + "'; ", 1000);
                } else {
                    layer.msg(data.msg , {icon:16,time:1500});
                }
            });
            return false;
        });
    });
</script>
{include file="common/index_footer"/}
